<html>
<head>
<link rel="stylesheet" type="text/css" href=<?php echo base_url()."zy.css"; ?> />
<title>添加病例</title>
<style type="text/css">
@import <?php echo '"'.base_url()."autocomplete.css".'"'; ?>; 
</style>
<?php
echo '<script language="javascript">';
echo 'var mybaseurl = "'.base_url().'";';
echo '</script>';
base_url()
?>
<script  type="text/javascript" src=<?php echo base_url()."zy.js"; ?> ></script>
<script type="text/javascript" src=<?php echo base_url()."jquery.js"; ?> ></script>
<script type="text/javascript" src=<?php echo base_url()."cal.js"; ?> ></script>
<LINK rel=stylesheet type=text/css href=<?php echo base_url()."calendar.css"; ?> >
<SCRIPT type=text/javascript> 
jQuery(document).ready(function () {
	$('input.one').simpleDatepicker({ startdate: '10/01/1949', enddate: '10/01/2100' });
});
</SCRIPT>
</head>
<body>
<center>
<?php
	$this->load->library('myphplib');
	myphplib::myheadlinks();
?>
<br />
<br />
<br />
<h1>添加病例</h1>

<?php
$index = $row->index;
$url = base_url()."index.php/zy_addcase/add";
echo form_open_multipart($url, "name=\"caseform\" onsubmit=\"return check()\"");
?>

<table>
<tr>
<td>姓名:</td>
<td>
<?php
$ndata = array('name' => 'patient_name', 'type' => 'text', 'value' => "$row->name", 'size' => '16');
echo form_input($ndata);
?>
</td>
<td>性别:</td>
<td>
<?php
	$options = array(
		  'M'  => '男性',
		  'F'    => '女性',
		);
	echo form_dropdown('patient_sex', $options, $row->sex);
?>
</td>
<td>年龄:</td>
<td>
<?php
$age = $row->age;

if ($age < 0)
{
	$age += 1000;
}

$ndata = array('name' => 'patient_age', 'type' => 'text', 'value' => "$age", 'size' => '8');
echo form_input($ndata);
?>
<?php
	$options = array(
		  'Y'			=> '岁',
		  'M'			=> '月',
		);
	echo form_dropdown('ageunit', $options, ($row->age < 0) ? 'M' : 'Y');
?>
</td>
<td>日期:</td>
<td><?php echo form_input('patient_date', date("Y-m-d"), 'size="16" class=one') ?></td>
</tr>
<tr>
<td>联系电话:</td>
<td>
<?php
$ndata = array('name' => 'patient_phonenum', 'type' => 'text', 'value' => "$row->phonenum", 'size' => '16');
echo form_input($ndata);
?>
</td>
<td>住址:</td>
<td colspan="5">
<?php
$ndata = array('name' => 'patient_addr', 'type' => 'text', 'value' => "$row->addr", 'size' => "100%");
echo form_input($ndata);
?>
</td>
</tr>
<tr>
<td>发病时间:</td>
<td>
<?php
$ndata = array('name' => 'patient_attackdate', 'type' => 'text', 'value' => "$row->attackdate", 'size' => '16', 'class' => 'one');
echo form_input($ndata);
?>
</td>
</tr>
<tr>
<td>病史:</td>
<td colspan="7"><textarea name="patient_diag" cols="100%" rows="10"></textarea></td>
</tr>
<tr>
<td>处方:</td>
<td colspan="7"><textarea name="patient_prescribe" cols="100%" rows="7"></textarea></td>
</tr>
<tr>
<td>
处方选择:
</td>
<td>
<div class="autoComplete" style="z-index:1"> <input id="seltip" name="prescribename" value="" /> <ul><li></li></ul> </div>
</td>
<td>
<input type="button" value='确定' onclick="check_prescribe()">
<td>新处方<input type="checkbox" name="patient_newprescribe"/></td>
</td>
</td>
</tr>
<td>煎煮法:</td>
<td colspan="7"><textarea name="patient_usemethod" cols="100%" rows="3"></textarea></td>
</tr>
<tr>
<td>备注:</td>
<td colspan="7"><textarea name="patient_comment" cols="100%" rows="3"></textarea></td>
</tr>
<tr>
<tr>
<td>上传文件</td>
<td colspan="7">
<input id="input1" type="file" name="patient_file1" onchange="return HandleFileNameChange(1)"><br />
<input id="input2" type="file" name="patient_file2" onchange="return HandleFileNameChange(2)"><br />
<input id="input3" type="file" name="patient_file3" onchange="return HandleFileNameChange(3)"><br />
<input id="input4" type="file" name="patient_file4" onchange="return HandleFileNameChange(4)"><br />
<input id="input5" type="file" name="patient_file5" onchange="return HandleFileNameChange(5)">
</td>
</tr>
<td></td>
</tr>
<tr>
<td colspan="8" align="center"><input type="submit" value="添加" style="font-size: 15px" /></td>
</tr>
</table>
</form>

</center>
</body>
</html>